#ifndef _STRAWGUI_SINGLETON_H_
#define _STRAWGUI_SINGLETON_H_

#define INIT_SINGLETON(t) t* sgui::sSingleton<t>::m_instance = NULL

namespace sgui
{

template <class T>
class sSingleton
{
private:
	static T *m_instance;
public:
	
	static T* GetInstance()
	{
		if (!m_instance)
		{
			m_instance = new T();
		}
		return m_instance;
	}

	static void ReleaseInstance()
	{
		if (m_instance)
		{
			delete m_instance;
			m_instance = NULL;
		}
	}

};

}

#endif